"""author: wenyao
   data: 2021/3/26
   project: devopscmdb
"""

#元组
#有序项目集合
#可以存放任何类型对象
#不可变数据类型


#####################元组的定义###########################
#只有一个元素，需要在元素后加逗号
# >>> tu1 = ()
# >>> type(tu1)
# <class 'tuple'>
# >>> tu2 = tuple()
# >>> type(tu2)
# <class 'tuple'>
# >>> #工厂函数
# ...
# >>> tu3 = tuple("abc")
# >>> tu3
# ('a', 'b', 'c')
# >>> dir(tu3)
# ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'count', 'index']
# >>> tu3.index("c")
# 2
# >>> tu3.count("c")
# 1
# >>> tu4 = (1)
# >>> type(tu4)
# <class 'int'>
# >>> tu4 = (1,)
# >>> type(tu4)
# <class 'tuple'>

#元组里面包列表，列表是可以改变的，因为列表是可变数据类型，列表里面元素更改不会改变列表本身
# >>> tu = ("a",1,None,[1,2])
# >>> tu[3]
# [1, 2]
# >>> tu[3].append(3)
# >>> tu
# ('a', 1, None, [1, 2, 3])

#返回的是元组，可以用多个参数接受元组中的每个元素
# >>> a = (1,2)
# >>> a
# (1, 2)
# >>> a,b = (1,2)
# >>> a
# 1
# >>> b
# 2
# >>> lst=["a","b","c"]
# >>> for i in enumerate(lst):
# ...     print(i)
# ...
# (0, 'a')
# (1, 'b')
# (2, 'c')
# >>> for i,j in enumerate(lst):
# ...    print(i,j)
# ...
# 0 a
# 1 b
# 2 c

print("欢迎使用用户检测系统".center(100,'*'))
tu1 = [('root','123456'),('admin','admin')]
while 1:
    a = input("请输入用户名：")
    b = input("请输入密码：")
    if (a,b) in tu1:
        print("登陆成功")
        break
    else:
        print("登陆失败")